// This file was decompiled using SASCM.ini published by GTAG (http://gtag.gtagaming.com/opcode-database) on 14.6.2013
{$CLEO .cs}

0000:

0390: load_txd_dictionary 'LD_DUAL'
038F: load_texture "white" as 10

Model.Load(#HYDRA)
Model.Load(#FAM1)
Model.Load(1636)
038B: load_requested_models 

04C4: store_coords_to 5@ 6@ 7@ from_actor $PLAYER_ACTOR with_offset 0.0 -100.0 80.0 
30@ = Car.Create(#HYDRA, 5@, 6@, 7@)
Actor.StorePos($PLAYER_ACTOR, 5@, 6@, 7@)
Car.SetImmunities(30@, 1, 1, 1, 1, 1)
039F: set_car 30@ race_to 5@ 6@ 
0825: set_helicopter 30@ instant_rotor_start 
29@ = Actor.CreateAsDriver(Gang2, #FAM1, 30@)
Actor.RemoveFromMissionCleanupList(29@)
Actor.Health(29@) = 100000
Actor.SetImmunities(29@, 1, 1, 1, 1, 1)
24@ = Marker.CreateAboveActor(29@)
04C4: store_coords_to 5@ 6@ 7@ from_actor $PLAYER_ACTOR with_offset 0.0 10.0 30.0 
04D2: set_plane 30@ fly_autopilot_around_point 5@ 6@ 7@ altitude_between 30.0 and 30.0 
0745: set_hydra 30@ thrust_to_horizontal 
0338: set_car 30@ visibility 0 
//067C: put_camera_on_actor $_hydra_pilot offset 0.0 -3.9 2.1 rotation 0.0 0.0 0.0 tilt 0.0 switchstyle 2 
        
FOR 16@ = 0 TO 8 STEP 1
    0085: 8@ = 16@ 
    8@ *= 4
    0AC6: 11@ = label @handle offset
    005A: 11@ += 8@                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                
    0A8D: 31@ = read_memory 11@ size 4 virtual_protect 0
    if 31@ > 0
    jf continue
    if 056E:   car 31@ defined
    jf continue
    car.RemoveReferences(31@)
    car.Destroy(31@)
END

MODEL.Load(#COMET)
038B: load_requested_models 


FOR 16@ = 0 TO 8 STEP 1
    0085: 8@ = 16@ 
    8@ *= 4
    04C4: store_coords_to 5@ 6@ 7@ from_actor $PLAYER_ACTOR with_offset 0.0 2.0 1.0 
    31@ = car.Create(#COMET,5@,6@,7@)                                                                                                                                                                   
    Car.Angle(31@) = 184.7214
    0229: set_car 31@ primary_color_to 0 secondary_color_to 0 
    099A: set_car 31@ collision_detection 0
    03ED: set_car 31@ disable_flipped_explosion_when_empty 1 
    Car.SetImmunities(31@, 1, 1, 1, 1, 1)

    0AC6: 11@ = label @handle offset
    005A: 11@ += 8@                                                                                                                                                               
    0A8C: write_memory 11@ size 4 value 31@ virtual_protect 0
END


WHILE TRUE
    WAIT 0
    0ab3: 569 > 29@ //send_handler
    0ab4: 17@ < 570 //get$state
    18@ = 0.0
    FOR 16@ = 0 TO 8 STEP 1
        if 056E:   car 30@ defined
        jf continue       
        //IF 01F3:   car $hydra_handler in_air
        //jf @CLEAN
        IF 17@ == FALSE                                                                                            
        jf @CLEAN1                                                                                                     
        0085: 8@ = 16@                                                                                                       
        8@ *= 4                                                                                                             
        0AC6: 11@ = label @handle offset                                                                                     
        005A: 11@ += 8@
        if 11@ < 0x3D94AD8E
        jf continue                                                                                                                                                                                                                                                                                                                                                                                                                                                                                            
        0A8D: 31@ = read_memory 11@ size 4 virtual_protect 0
        if 31@ > 0
        jf continue                                                                  
        18@ += 40.0                                                                                                     
        if 18@ > 360.0                                                                                                  
        then 18@ = 0.0                                                                                                  
        end                                                                                                                 
        0407: store_coords_to 5@ 6@ 7@ from_car 30@ with_offset 0.0 0.0 -1.0
        if 31@ > 0                                                                                                           
        jf continue                                                                                                         
        if 056E:   car 31@ defined                                                                                           
        jf continue                                                                                                         
        CAR.PutAt(31@, 5@, 6@, 7@)                                                                                          
        0683: attach_car 31@ to_car 30@ with_offset 0.0 0.0 0.0 rotation 0.0 0.0 18@
        IF 33@ >= 6000                                                                                                     
        THEN 33@ = 0                                                                                                       
            0209: 19@ = random_int_in_ranges 1 5                                                                           
            if 19@ == 1                                                                                                    
            then GOSUB @wats_hapen1                                                                                        
            end                                                                                                            
            if 19@ == 2                                                                                                    
            then GOSUB @wats_hapen2                                                                                        
            end                                                                                                            
            if 19@ == 3                                                                                                    
            then GOSUB @wats_hapen3                                                                                        
            end                                                                                                            
            if 19@ == 4                                                                                                    
            then GOSUB @wats_hapen4                                                                                        
            end                                                                                                            
            if 19@ == 5                                                                                                    
            then GOSUB @wats_hapen4                                                                                        
            end                                                                                                              
            09E5: create_flash_light_at 5@ 6@ 7@ RGB_mask 0 255 255 radius 30.0                                         
            024F: create_corona_with_radius 10.0 type 2 lensflares 0 with_color 0 255 255 at 5@ 6@ 7@                   
        end                                                                                                                
    end
    if 81F3:   not car 30@ in_air 
    then
        0407: store_coords_to 5@ 6@ 7@ from_car 30@ with_offset 0.0 0.0 100.0
        CAR.PutAt(30@, 5@, 6@, 7@)     
    end
END

:CLEAN1
0ACA: "CLEAN" 
FOR 16@ = 0 TO 8 STEP 1
    0085: 8@ = 16@ 
    8@ *= 4
    0AC6: 11@ = label @handle offset
    005A: 11@ += 8@                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                
    0A8D: 31@ = read_memory 11@ size 4 virtual_protect 0
    if 31@ > 0
    jf continue
    if 056E:   car 31@ defined
    jf continue
    car.RemoveReferences(31@)
    car.Destroy(31@)
END
car.RemoveReferences(30@)
actor.RemoveReferences(29@)
end_thread



:wats_hapen1
//0ACA: "ATTACK1"  
FOR 20@ = 0 TO 0 STEP 1             
    Actor.StorePos(29@, 21@, 22@, 23@)                                                                                                                                                             
    if 0AE1: 25@ = random_actor_near_point 21@ 22@ 23@ in_radius 1000.0 find_next 1 pass_deads 0 //IF and SET                                                                              
    jf continue                                                                                                                                                                                    
    if not 25@ == -1                                                                                                                                                                       
    jf continue                                                                                                                                                                                    
    089F: get_actor 25@ pedtyp_to 26@                                                                                                                                                      
    if not 26@ == 8 //vehicle gunner                                                                                                                                                               
    jf continue
    04C4: store_coords_to 12@ 13@ 14@ from_actor 25@ with_offset 0.0 0.0 30.0                                                                                                                          
    Car.PutAt(30@, 12@, 13@, 14@)                                                                                                                                                              
    Car.LockInCurrentPosition(30@) = TRUE
    for 27@ = 0 to 10 step 1
        IF 056D:   actor 25@ defined                                                                                                                                                        
        JF BREAK                                                                                                     
        if not actor.Dead(25@)                                                                                       
        JF BREAK                                                                                                     
        04C4: store_coords_to 0@ 1@ 2@ from_actor 25@ with_offset 0.0 1.0 0.5                                        
        if 27@ == 27@                                                                                                
        then                                                                                                         
        0AB1: call_scm_func @getScreenXYFrom3DCoords6 3 3D_coords_X 0@ Y 1@ Z 2@ store_screen_X_to 3@ Y_to 4@         
        0AB1: @DRAW_OUTLINED_BOX4 9 POS 3@ 4@ SIZE 50.0 100.0 RGBA 255 0 0 255 THICKNESS 0.5                          
        //0AB1: @DRAW_LINE 9 POS 3@ 4@  _TO_ 200.0 400.0 RGBA 255 0 0 255 THICKNESS 2.0                                
        end                                                                                                          
        0948: create_explosion_at 0@ 1@ 2@ type 1 {fire this targed} camera_shake 1.0                                
        wait 0                                                                                                       
    end
    Car.LockInCurrentPosition(30@) = FALSE                                                                                                                                                             
    04C4: store_coords_to 5@ 6@ 7@ from_actor $PLAYER_ACTOR with_offset 0.0 10.0 30.0                                                                                                               
    04D2: set_plane 30@ fly_autopilot_around_point 5@ 6@ 7@ altitude_between 30.0 and 30.0
end
return

:wats_hapen2
//0ACA: "ATTACK2"  
FOR 20@ = 0 TO 0 STEP 1                                                                                                                                                                                                                                                                                                                                  
    Actor.StorePos(29@, 21@, 22@, 23@)                                                                                                                                                               
    if 0AE1: 25@ = random_actor_near_point 21@ 22@ 23@ in_radius 1000.0 find_next 1 pass_deads 0 //IF and SET                                                                                          
    jf continue                                                                                                                                                                                
    if not 25@ == -1                                                                                                                                                                                   
    jf continue                                                                                                                                                                                
    089F: get_actor 25@ pedtyp_to 26@                                                                                                                                                                  
    if not 26@ == 8 //vehicle gunner                                                                                                                                                           
    jf continue                                                                                                                                                                                        
    04C4: store_coords_to 12@ 13@ 14@ from_actor 25@ with_offset 0.0 0.0 30.0                                                                                                                          
    Car.PutAt(30@, 12@, 13@, 14@)                                                                                                                                                              
    Car.LockInCurrentPosition(30@) = TRUE                                                                                                                                                              
    VAR                                                                                                                                                                                          
    9@:FLOAT                                                                                                                                                                                          
    10@:FLOAT
    28@:FLOAT                                                                                                                                                                                                
    END                                                                                                                                                                                                
    0819: 9@ = actor 29@ distance_from_ground                                                                                                                                                                
    9@ -= 10.0                                                                                                                                                                                         
    0819: 10@ = actor 25@ distance_from_ground                                                                                                                                                         
    33@ = 0
    0ab3: 568 > true     
    //0A92: create_custom_thread "14FA51F5D0\ship_func.CS"             
    for 28@ = 10@ to 9@ step 0.2                                                                                                                                                                  
        if 33@ >= 12000                                                                                                                                                                             
        then break                                                                                                                                                                                      
        end                                                                                                                                                  
        IF 056D:   actor 25@ defined                                                                                                                                                            
        JF BREAK
        if not actor.Dead(25@)
        JF BREAK                                                                                                                                                                                 
        083C: set_actor 25@ velocity_in_direction_XYZ 0.0 0.0 9@                                                                                                                                   
        04C4: store_coords_to 12@ 13@ 14@ from_actor 25@ with_offset 0.0 0.0 0.0                                                                                                               
        04C4: store_coords_to 5@ 6@ 7@ from_actor 29@ with_offset 0.0 0.0 -0.4                                                                                                              
        024F: create_corona_with_radius 2.0 type 2 lensflares 0 with_color 0 255 255 at 12@ 13@ 14@                                                                                                    
        024F: create_corona_with_radius 0.5 type 2 lensflares 0 with_color 0 255 255 at 5@ 6@ 7@                                                                                                    
        0393: actor 25@ perform_animation "RUN_ARMED" at 20.0 times_normal_rate                                                                                                                       
        0393: actor 25@ perform_animation "SPRINT_CIVI" at 20.0 times_normal_rate                                                                                                             
        0332: set_actor 25@ bleeding 1                                                                                                                                                         
        WAIT 0                                                                                                                                                                                 
    end                                                                                                                                                                                                
    Car.LockInCurrentPosition(30@) = FALSE                                                                                                                                                             
    04C4: store_coords_to 5@ 6@ 7@ from_actor $PLAYER_ACTOR with_offset 0.0 10.0 30.0                                                                                                               
    04D2: set_plane 30@ fly_autopilot_around_point 5@ 6@ 7@ altitude_between 30.0 and 30.0
    0ab3: 568 > false                                                                                                          
end                                                                                                                                                                                                    
RETURN

:wats_hapen3
//0ACA: "ATTACK3"  
FOR 20@ = 0 TO 0 STEP 1             
    Actor.StorePos(29@, 21@, 22@, 23@)                                                                                                                                                             
    if 0AE1: 25@ = random_actor_near_point 21@ 22@ 23@ in_radius 1000.0 find_next 1 pass_deads 0 //IF and SET                                                                              
    jf continue                                                                                                                                                                                    
    if not 25@ == -1                                                                                                                                                                       
    jf continue                                                                                                                                                                                    
    089F: get_actor 25@ pedtyp_to 26@                                                                                                                                                      
    if not 26@ == 8 //vehicle gunner                                                                                                                                                               
    jf continue
    04C4: store_coords_to 12@ 13@ 14@ from_actor 25@ with_offset 0.0 0.0 30.0                                                                                                                          
    Car.PutAt(30@, 12@, 13@, 14@)                                                                                                                                                              
    Car.LockInCurrentPosition(30@) = TRUE
    for 27@ = 0 to 10 step 1
        IF 056D:   actor 25@ defined                                                                                                                                                        
        JF BREAK                                                                                                                
        if not actor.Dead(25@)                                                                                                  
        JF BREAK                                                                                                                
        04C4: store_coords_to 0@ 1@ 2@ from_actor 25@ with_offset 0.0 1.0 0.5                                                   
        if 27@ == 27@                                                                                                           
        then                                                                                                                    
            0AB1: call_scm_func @getScreenXYFrom3DCoords6 3 3D_coords_X 0@ Y 1@ Z 2@ store_screen_X_to 3@ Y_to 4@                
            0AB1: @DRAW_OUTLINED_BOX4 9 POS 3@ 4@ SIZE 50.0 50.0 RGBA 0 255 0 200 THICKNESS 3.5                                  
            //0AB1: @DRAW_LINE 9 POS 3@ 4@  _TO_ 200.0 400.0 RGBA 255 0 0 255 THICKNESS 2.0                                       
        end                                                                                                                     
        0208: 1@ = random_float_in_ranges -1.2 1.2                                                                              
        0208: 2@ = random_float_in_ranges -1.2 1.2                                                                              
        04C4: store_coords_to 0@ 1@ 2@ from_actor 25@ with_offset 1@ 0.0 2@                                                     
        06BC: create_M4_shoot_from 21@ 22@ 23@ target 0@ 1@ 2@ energy 50                                                        
        wait 0                                                                                                                  
    end
    Car.LockInCurrentPosition(30@) = FALSE                                                                                                                                                             
    04C4: store_coords_to 5@ 6@ 7@ from_actor $PLAYER_ACTOR with_offset 0.0 10.0 30.0                                                                                                               
    04D2: set_plane 30@ fly_autopilot_around_point 5@ 6@ 7@ altitude_between 30.0 and 30.0
end
return


:wats_hapen4
//0ACA: "ATTACK4"  
FOR 20@ = 0 TO 0 STEP 1             
    Actor.StorePos(29@, 21@, 22@, 23@)                                                                                                                                                             
    if 0AE1: 25@ = random_actor_near_point 21@ 22@ 23@ in_radius 1000.0 find_next 1 pass_deads 0 //IF and SET                                                                              
    jf continue                                                                                                                                                                                    
    if not 25@ == -1                                                                                                                                                                       
    jf continue                                                                                                                                                                                    
    089F: get_actor 25@ pedtyp_to 26@                                                                                                                                                      
    if not 26@ == 8 //vehicle gunner                                                                                                                                                               
    jf continue
    04C4: store_coords_to 12@ 13@ 14@ from_actor 25@ with_offset 0.0 0.0 30.0                                                                                                                          
    Car.PutAt(30@, 12@, 13@, 14@)                                                                                                                                                              
    Car.LockInCurrentPosition(30@) = TRUE
    for 27@ = 0 to 10 step 1
        IF 056D:   actor 25@ defined                                                                                                                                                        
        JF BREAK
        if not actor.Dead(25@)                                                                                                  
        JF BREAK                                                                                                                 
        04C4: store_coords_to 0@ 1@ 2@ from_actor 25@ with_offset 0.0 1.0 0.5                                             
        if 27@ == 27@                                                                                                     
        then                                                                                                              
            0AB1: call_scm_func @getScreenXYFrom3DCoords6 3 3D_coords_X 0@ Y 1@ Z 2@ store_screen_X_to 3@ Y_to 4@          
            0AB1: @DRAW_OUTLINED_BOX4 9 POS 3@ 4@ SIZE 50.0 100.0 RGBA 255 0 0 255 THICKNESS 0.5                           
            //0AB1: @DRAW_LINE 9 POS 3@ 4@  _TO_ 200.0 400.0 RGBA 255 0 0 255 THICKNESS 2.0                                 
        end                                                                                                               
        0948: create_explosion_at 0@ 1@ 2@ type 0 {fire this targed} camera_shake 1.0                                     
        wait 0                                                                                                            
    end
    Car.LockInCurrentPosition(30@) = FALSE                                                                                                                                                             
    04C4: store_coords_to 5@ 6@ 7@ from_actor $PLAYER_ACTOR with_offset 0.0 10.0 30.0                                                                                                               
    04D2: set_plane 30@ fly_autopilot_around_point 5@ 6@ 7@ altitude_between 30.0 and 30.0
end
return



//
:DRAW_LINE2
0087: 11@ = 2@ // (float)
0087: 12@ = 3@ // (float)
0509: 10@ = distance_between_XY 0@ 1@ and_XY 2@ 3@
10@ -= 37.0 {REMOVE STRANGE OFFSET AT END}
0063: 2@ -= 0@ // (float) 
0063: 3@ -= 1@ // (float) 
0604: get_Z_angle_for_point 2@ 3@  store_to 9@
9@ += 84.0
005B: 0@ += 11@
0@ /= 2.0    {MITTE} // get center pos
005B: 1@ += 12@
1@ /= 2.0
03F0: enable_text_draw 1
074B: draw_texture 10 position 0@ 1@ scale 10@ 8@ angle 9@ color 4@ 5@ 6@ 7@
0AB2: 0

:DRAW_OUTLINED_BOX4
0087: 14@  = 8@ // (float)
0087: 12@ = 2@ // (float)
0087: 13@ = 3@ // (float)
12@ /= 2.0 // (float)
13@ /= 2.0 // (float)
0087: 8@  = 0@ // (float)
005B: 8@ += 2@  // (float)
0063: 8@ -= 12@  // (float) 
0087: 9@  = 0@ // (float) 
0063: 9@ -= 2@  // (float)
005B: 9@ += 12@  // (float) 
0087: 10@ = 1@ // (float)
005B: 10@ += 3@  // (float) 
0063: 10@ -= 13@  // (float) 
0087: 11@ = 1@ // (float)     by OpcodeXe
0063: 11@ -= 3@  // (float)
005B: 11@ += 13@  // (float)   
03F0: enable_text_draw 1                                    
038E: draw_box_position  8@ 1@  size 14@ 3@ RGBA 4@ 5@ 6@ 7@ //  links
038E: draw_box_position  9@ 1@  size 14@ 3@ RGBA 4@ 5@ 6@ 7@  // rechts
038E: draw_box_position  0@ 10@  size 2@ 14@ RGBA 4@ 5@ 6@ 7@  // oben 
038E: draw_box_position  0@ 11@  size 2@ 14@ RGBA 4@ 5@ 6@ 7@  // unten 
0AB2: 0



//
:getScreenXYFrom3DCoords6
0AC7: 14@ = var 0@ offset
0AC7: 15@ = var 3@ offset
0AC7: 16@ = var 6@ offset
0AC7: 17@ = var 9@ offset
0AA5: call 0x70CE30 num_params 6 pop 6  0 0 17@ 16@ 15@ 14@
0007: 12@ = 640.0
0007: 13@ = 448.0
0A8D: 14@ = read_memory 0xC17044 size 4 virtual_protect 0
0A8D: 15@ = read_memory 0xC17048 size 4 virtual_protect 0
0093: 14@ = integer 14@ to_float
0093: 15@ = integer 15@ to_float
0073: 12@ /= 14@
0073: 13@ /= 15@
006B: 3@ *= 12@
006B: 4@ *= 13@
0AB2: ret 2 3@ 4@

:handle
hex
00 00 00 00
00 00 00 00
00 00 00 00
00 00 00 00
00 00 00 00
00 00 00 00
00 00 00 00
00 00 00 00
00 00 00 00
end